package cn.tedu.boot041.mapper;

import cn.tedu.boot041.entity.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentMapper {

    @Insert("INSERT INTO student VALUES (NULL,#{name},#{age},#{gender})")
    int insert(Student stu);

    @Delete("DELETE FROM student WHERE id=#{id}")
    int deleteById(int id);

    @Update("UPDATE student SET name=#{name},age=#{age},gender=#{gender} WHERE id=#{id}")
    int update(Student stu);

    @Select("SELECT * FROM student")
    List<Student> select();
}
